import { View, Text, useColorScheme } from "react-native";
import React from "react";
import { SafeAreaView } from "react-native-safe-area-context";
import { useColor } from "@/hooks/color";
import { Colors } from "react-native-ui-lib";
import { StatusBar } from "expo-status-bar";

interface IPageProps {
  children?: React.ReactNode;
  edge?: React.ComponentProps<typeof SafeAreaView>["edges"];
}

const PageView: React.FC<IPageProps> = ({ children, edge = ["bottom", "left", "right", "top"] }) => (
  <SafeAreaView edges={edge} style={{ flex: 1, backgroundColor: useColor().colors.background, paddingHorizontal: 15, paddingVertical: 0 }}>
    <StatusBar style={useColorScheme() == "dark" ? "light" : "dark"} />
    {children}
  </SafeAreaView>
);

export default PageView;
